package windowFactoryPackage;

import javax.swing.*;
import java.awt.event.*;

public class ViewProgramButton extends JButton{
	
	public ViewProgramButton(){
		super("View Program");
		this.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				for(int i = 0; i<UserReviewWindow.programButtonList.size(); i++){
					if(e.getSource() == UserReviewWindow.programButtonList.get(i)){
						System.out.println("ViewUserButton pressed at position " + i);
						SearchWindow.setSearch(Query.reviewProgName.get(i), "p");
					}
				}
			}
		});
	}
}
